package com.vm.osm.business.dto.eam.equ_part;

import com.google.common.base.MoreObjects;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * 设备配件分页应答
 *
 * @author Xuerong Xue
 */
@Data
public class SearchEamEquPartRsp implements Serializable {
    @ApiModelProperty(value = "数据列表")
    private List<EquPartRow> data_list;
    @ApiModelProperty("分页总数")
    private Integer page_num;
    @ApiModelProperty("分页大小")
    private Integer page_size;
    @ApiModelProperty("总记录数")
    private Long total_num;

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("data_list", data_list == null ? null : Arrays.toString(data_list.toArray()))
                .add("page_num", page_num)
                .add("page_size", page_size)
                .add("total_num", total_num)
                .toString();
    }

    /**
     * 设备配件分页行
     *
     * @author Xuerong Xue
     */
    @Data
    public static class EquPartRow implements Serializable {
        private String brand;
        @ApiModelProperty("配件编号")
        private String equ_part_code;
        @ApiModelProperty("配件类型编号")
        private String equ_part_type_id;
        @ApiModelProperty("配件类型名称")
        private String equ_part_type_name;
        @ApiModelProperty("系统编号")
        private String id;
        @ApiModelProperty("型号")
        private String model;
        @ApiModelProperty("规格")
        private String spec;
        @ApiModelProperty("库存下限")
        private Integer stock_down_limit;
        @ApiModelProperty("库存数量")
        private Integer stock_num;
        @ApiModelProperty("库存上限")
        private Integer stock_up_limit;
        @ApiModelProperty("存放仓库")
        private String ware_house_name;

        @Override
        public String toString() {
            return MoreObjects.toStringHelper(this)
                    .add("brand", brand)
                    .add("equ_part_code", equ_part_code)
                    .add("equ_part_type_id", equ_part_type_id)
                    .add("equ_part_type_name", equ_part_type_name)
                    .add("id", id)
                    .add("model", model)
                    .add("spec", spec)
                    .add("stock_down_limit", stock_down_limit)
                    .add("stock_num", stock_num)
                    .add("stock_up_limit", stock_up_limit)
                    .add("ware_house_name", ware_house_name)
                    .toString();
        }
    }
}
